package com.roy.comet;

import com.roy.comet.enums.StrategyEnum;

import java.util.List;

/**
 * Created by mc on 18/4/13.
 */
public class CometTable {

    private String dbName;
    private String tableName;
    private int dbNum;
    private int tableNum;

    private StrategyEnum strategyEnum = StrategyEnum.HASH ;
    private CometStrategy cometStrategy;
    private List<CometNode> cometNodes;

    public void init() {
        if (strategyEnum == StrategyEnum.HASH){
            this.cometStrategy = new CometHashStrategy(dbNum, tableNum);}
    }

    public String getDbName() {
        return dbName;
    }

    public void setDbName(String dbName) {
        this.dbName = dbName;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public int getDbNum() {
        return dbNum;
    }

    public void setDbNum(int dbNum) {
        this.dbNum = dbNum;
    }

    public int getTableNum() {
        return tableNum;
    }

    public void setTableNum(int tableNum) {
        this.tableNum = tableNum;
    }

    public StrategyEnum getStrategyEnum() {
        return strategyEnum;
    }

    public void setStrategyEnum(StrategyEnum strategyEnum) {
        this.strategyEnum = strategyEnum;
    }

    public CometStrategy getCometStrategy() {
        return cometStrategy;
    }

    public void setCometStrategy(CometStrategy cometStrategy) {
        this.cometStrategy = cometStrategy;
    }

    public List<CometNode> getCometNodes() {
        return cometNodes;
    }

    public void setCometNodes(List<CometNode> cometNodes) {
        this.cometNodes = cometNodes;
    }
}
